﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DefaultHT.Master" AutoEventWireup="true"
    CodeBehind="Booking.aspx.cs" Inherits="Hotel.Operations.Booking"
    Theme="Theme1" %>

<asp:Content ID="contentHead" runat="server" ContentPlaceHolderID="head">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link rel="stylesheet" href="../Styles/Main.css" type="text/css" />
    <link rel="stylesheet" href="../Scripts/css/jquery.ui.all.css" type="text/css">
    <link rel="stylesheet" href="../Scripts/css/jquery.ui.theme.css" type="text/css">
    <script src="../Scripts/jquery-1.8.2.js"></script>
    <script src="../Scripts/jquery-1.4.1.min.js"></script>
    <script src="../Scripts/jquery.ui.core.js"></script>
    <script src="../Scripts/jquery.ui.widget.js"></script>
    <script src="../Scripts/jquery.ui.datepicker.js"></script>
    <link rel="stylesheet" href="../Scripts/css/demos.css" type="text/css">
        
     <script>
         $(function () {
             //$("#txtStartDate").datepicker();
             //   $(".datepicker").datepicker();
             //$("input[id$='txtStartDate']").datepicker();
             //$("input[id$='txtEndate']").datepicker();
             $("input[id$='txtStartDate']").datepicker({
                 // defaultDate: "+1w",
                 changeYear: true,
                 changeMonth: true,
                 // numberOfMonths: 3,
                 onSelect: function (selectedDate) {
                     $("input[id$='txtEndate']").datepicker("option", "minDate", selectedDate);
                 }
             });
             $("input[id$='txtEndate']").datepicker({
                 // defaultDate: "+1w",
                 changeMonth: true,
                 changeYear: true,
                 //numberOfMonths: 3,
                 onSelect: function (selectedDate) {
                     $("input[id$='txtStartDate']").datepicker("option", "maxDate", selectedDate);
                 }
             });

             $("input[id$='btnSearch']").click(function () {
                 var sDate = Date.parse($("input[id$='txtStartDate']").val());
                 var eDate = Date.parse($("input[id$='txtEndate']").val());
                 if (sDate > eDate) {
                     alert('start date cannot be greater than end date');
                     return false;
                 }

             });

         });






     </script> 
    <div style="height: 30px; padding: 10px 10px 10px 10px;">
		<h2>Booking</h2>
	</div>
    <div style="text-align: center">
        <asp:MultiView ID="BookingView" runat="server">
            <asp:View  ID="BookView" runat="server">
		<div style="text-align: left; padding-left: 10px;padding-top:5px;">
			<table>
				<tr>
					<td >
						Booking Number
					</td>
					<td>
					<asp:TextBox ID="txtRoomNumber" runat="server" Width="100" CssClass="textbox"></asp:TextBox> 
					</td> 
					<td>
						Room Type
					</td>
					<td valign="middle">
						<asp:DropDownList ID="ddlRoomType" runat="server" Width="100px" CssClass="dropdown">
							
						</asp:DropDownList>
					</td>
					<td>
						StartDate
					</td>
					<td> 
                          <div class="demo">   
						<asp:TextBox ID="txtStartDate" runat="server" Width="100" CssClass="textbox"></asp:TextBox>
                             </div>
					</td>
					<td>
                       
						EndDate
                           
					</td>
					<td>
                             <div class="demo"> 
						<asp:TextBox ID="txtEndate" runat="server" Width="100" CssClass="textbox"></asp:TextBox> </div>
                               
					</td>
					<td>
						<asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="button" OnClick="btnSearch_Click" />
					</td>
				</tr>
			</table>
		</div>
		<div style="padding-left:10px;">
			<br />
			<asp:GridView ID="GridStatus" runat="server" CellPadding="4" ForeColor="#333333"
				GridLines="Vertical" AutoGenerateColumns="False" 
				CssClass="grid" AlternatingRowStyle-CssClass="gridAltRow" RowStyle-CssClass="gridRow" 
                EditRowStyle-CssClass="gridEditRow" FooterStyle-CssClass="gridFooterRow" 
                AllowSorting="True" DataKeyNames="BookingId" 
                OnSelectedIndexChanged="GridStatus_SelectedIndexChanged" >
			    <Columns>
                     <asp:TemplateField >
                      <ItemTemplate>   <asp:LinkButton ID="lnkEdit" runat="server"  CommandName="select"        Text="Edit"></asp:LinkButton>

                      </ItemTemplate>
                      
                  </asp:TemplateField>
                    <asp:BoundField DataField="BookingNumber" HeaderText="BookingNumber"             />
                    <asp:BoundField DataField="RoomType" HeaderText="RoomType" ItemStyle-HorizontalAlign="Left" />
                    <asp:BoundField DataField="BookingDate" HeaderText="BookingDate"  DataFormatString="{0:d}"            ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="DaysBooked" HeaderText="DaysBooked"   ItemStyle-HorizontalAlign="Center"           />
                    <asp:CheckBoxField DataField="PickupRequired" HeaderText="PickupRequired"                />
                    <asp:BoundField DataField="AdvancePaid" HeaderText="AdvancePaid" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n2}"/>
                    <asp:BoundField DataField="GuestName" HeaderText="GuestName" ReadOnly="True"   ItemStyle-HorizontalAlign="Left"        />
                    <asp:BoundField DataField="Email" HeaderText="Email"   ItemStyle-HorizontalAlign="Left"/>
                    <asp:BoundField DataField="Phone" HeaderText="Phone"   ItemStyle-HorizontalAlign="Left"/>
                    <asp:BoundField DataField="Cancelled" HeaderText="Cancelled"     ItemStyle-HorizontalAlign="Left"  />
                    <asp:BoundField DataField="CancelReason" HeaderText="CancelReason"   ItemStyle-HorizontalAlign="Left"
                        />
                    <asp:BoundField DataField="CancellationFee" HeaderText="CancellationFee"         />
                </Columns>
			<EmptyDataTemplate>
                <div style="text-align:center;width:650px;">No Data Found.</div>

			</EmptyDataTemplate>
			</asp:GridView>
		     
		</div>
            </asp:View>

             <asp:View  ID="EditView" runat="server">
<table style="width:100%;">
    <tr><td>&Booking Number</td><td>	<asp:TextBox ID="txtBookingNumber" runat="server" Width="100" CssClass="textbox"></asp:TextBox>  </td>
        <td>Room Type</td><td><asp:DropDownList ID="ddlBookingType" runat="server" Width="100px" CssClass="dropdown">
							
						</asp:DropDownList></td></tr>
    <tr><td>Expected CheckIn Date</td><td>
        <asp:TextBox ID="txtECheckInDate" runat="server" CssClass="textbox" 
            Width="100"></asp:TextBox>
        </td><td>Length Of Stay</td><td>
        <asp:TextBox ID="txtLengthOfStay" runat="server" CssClass="textbox" 
            Width="100"></asp:TextBox>
        </td>

    </tr><tr><td>Pickup Required</td><td>
        <asp:CheckBox ID="chkPickUp" runat="server" />
        </td><td>Guest Name</td><td>
        <asp:TextBox ID="txtGuestName" runat="server" CssClass="textbox" 
            Width="100"></asp:TextBox>
        </td></tr>

    <tr>
        <td>Email</td>
        <td>
            <asp:TextBox ID="txtEmail" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
        <td>Phone</td>
        <td>
            <asp:TextBox ID="txtPhone" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Advance Payment</td>
        <td>
            <asp:TextBox ID="txtAdvancePayment" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
        <td>Advance Payment Mode</td>
        <td>
           <asp:DropDownList ID="ddlPayMode" runat="server" Width="100px" CssClass="dropdown">
							
						</asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>Advance Amount</td>
        <td>
            <asp:TextBox ID="txtAdvanceAmount" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
        <td>Advance Payment Date</td>
        <td>
            <asp:TextBox ID="txtAdvancePaymentDate" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Advance Payment Surcharge</td>
        <td>
            <asp:TextBox ID="txtAdvancePaymentSurcharge" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
        <td>Advance Payment Description</td>
        <td>
            <asp:TextBox ID="txtAdvancePaymentDescription" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Advance Clearance Flag</td>
        <td>
            <asp:CheckBox ID="CheckBoxAdvanceClearanceFlag" runat="server" />
        </td>
        <td>Cancel Payment</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>Cancel Reason</td>
        <td>
            <asp:TextBox ID="txtCancelReason" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
        <td>Cancel Fee Payment Mode</td>
        <td>  <asp:DropDownList ID="ddlCPaymentMode" runat="server" Width="100px" CssClass="dropdown">
							
						</asp:DropDownList></td>
    </tr>
    <tr>
        <td>Cancellation Fee</td>
        <td>
            <asp:TextBox ID="txtCancellationFee" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
        <td>Cancel Fee Surchage</td>
        <td>
            <asp:TextBox ID="txtCancelFeeSurchage" runat="server" CssClass="textbox" 
                Width="100"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>Cancellation Clearance flag</td>
        <td>
            <asp:CheckBox ID="CheckBoxCancellationClearanceflag" runat="server" />
        </td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>
            <asp:Button ID="btnSave" runat="server" CssClass="button" 
                 Text="Save" />
            <asp:Button ID="btnCancel" runat="server" CssClass="button" 
                 Text="Cancel" />
        </td>
        <td>&nbsp;</td>
    </tr>

</table>
                 </asp:View>

        </asp:MultiView>
	</div>
</asp:Content>
